import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login'
import ManagerLogin from '@/components/ManagerLogin'
import Home from '@/components/Home'
import ManagerHome from '@/components/ManagerHome'
import SportsCircle from '@/components/SportsCircle'
import Team from '@/components/Team'
import MyTieZi from '@/components/MyTieZi'
import TableMain from '@/components/TableMain'
import typeCircle from '@/components/typeCircle'
import TieZiMoKuai from '@/components/TieZiMoKuai'


// 单页面应用  引进资源
//映射资源
//映射完成后可以通过component访问相关内容
Vue.use(Router)

export default new Router({
  routes: [
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   component: HelloWorld
    // },
    {
      path: '/',
      name: '登录',
      component: Login
    },
    {
      path: '/ManagerLogin',
      name: '管理员登录',
      component: ManagerLogin
    },
    {
      path: '/Home',
      name: '主页',
      component: Home
    },
    {
      path: '/ManagerHome',
      name: '管理员主页',
      component: ManagerHome
    },
    {
      path: '/TableMain',
      name: 'Table',
      component: TableMain
    } ,
    {
      path: '/SportsCircle',
      name: '帖子社区',
      component: SportsCircle
    },
    {
      path: '/MyTieZi',
      name: '我的贴子',
      component: MyTieZi
    },
    {
      path: '/Team',
      name: '我的关注',
      component: Team
    },
    {
      path: '/typeCircle',
      name: '标签页',
      component: typeCircle
    },
    {
      path: '/TieZiMoKuai',
      name: '模块页',
      component: TieZiMoKuai
    },
  ]
})

// import Router from 'Router'
// const originalPush = Router.prototype.push
// Router.prototype.push = function push(location) {
//   return originalPush.call(this, location).catch(err => err)
// }